package a24_PolymorphicPractice;

/**
 * @Author quan
 * @Description 子类
 * @Date 2023/2/12 22:39
 */
public class Dog extends Animal{
    //继承于父类的构造方法
    public Dog() {
    }

    public Dog(int age, String color) {
        super(age, color);
    }
    //eat方法:重写
    @Override
    public void eat(String something){
        System.out.println(getAge()+"岁的"+getColor()+"色的狗狗在吃"+something);
    }
    //看家方法
    public void lookHome(){
        System.out.println("狗在看家");
    }
}
